<template>
  <div class="flex flex-direction" style="height: 45%">
    <!-- <checked-title title="最新案件列表"></checked-title> -->
    <JxcsTitle title="最新案件列表" />
    <CaseDetails ref="case"></CaseDetails>
    <div @click="workOrderDetails($event)" class="warp-box">
      <vue-seamless-scroll :class-option="classOption" :data="scrollData" class="warp" ref="mySwiper">
        <ul>
          <li :key="'a' + index" v-for="(item, index) in scrollData" class="anjian-item">
            <div class="latest_case">
              <div class="latest_case_title">
                <p>
                  <span :class="['aj-remark', item.remark === '重要事项' ? 'red' : 'blue']">{{ item.remark }}</span>
                  <span class="aj-text">{{ item.whistleTitle }}</span>
                </p>
              </div>
              <div class="latest_case_weizhi">
                <!-- <p>{{ item.createTime }}</p> -->
                <ul class="icon-tip">
                  <li>
                    <img :src="icon01" alt="" />
                    <span class="overView">{{ item.responsible_department }}</span>
                  </li>
                  <li>
                    <img :src="icon02" alt="" />
                    <span class="overView">{{ item.proposed_department }}</span>
                  </li>
                  <li>
                    <img :src="icon04" alt="" />
                    <span class="overView">{{ item.createTime }}</span>
                  </li>
                  <li>
                    <img :src="icon03" alt="" />
                    <span class="overView">{{ item.streetOrgName }}</span>
                  </li>
                </ul>
                <p class="view">
                  <span :data-item="JSON.stringify(item)">查看</span>
                </p>
              </div>
            </div>
          </li>
        </ul>
      </vue-seamless-scroll>
    </div>
  </div>
</template>

<script>
import vueSeamlessScroll from 'vue-seamless-scroll'
import Bus from '@/untils/bus'
import CaseDetails from '@/components/caseDetails.vue'
import $ from 'jquery'
import JxcsTitle from '@/components/JxcsTitle'

export default {
  components: {
    vueSeamlessScroll,
    CaseDetails,
    JxcsTitle
  },
  props: {
    classOption: {
      type: Object,
      default: () => {}
    },
    scrollData: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      newList: [],
      icon01: require('@/assets/images/jiexiangchuishao/aj01.png'),
      icon02: require('@/assets/images/jiexiangchuishao/aj02.png'),
      icon03: require('@/assets/images/jiexiangchuishao/aj03.png'),
      icon04: require('@/assets/images/jiexiangchuishao/aj04.png')
    }
  },
  computed: {},
  methods: {
    // 工单详情
    workOrderDetails(e) {
      let obj = $(e.target).data('item')
      Bus.$emit('openCsajDetail', obj.orderNum)
    }
  }
}
</script>

<style lang="less" scoped>
.swiper-container {
  height: 400px;
}

.swiper-slide {
  height: 180px !important;
}

.chunk_con {
  // height: calc(100% - 40px);
  height: 100%;
}

.warp-box {
  height: 400px;
  overflow: hidden;
}
.warp {
  overflow: hidden;
  height: 350px;
}

.latest_case {
  width: 100%;
  // background: rgba(31, 73, 135, 0.25);
  // margin-top: 20px;
  background: url(../../../assets/images/jiexiangchuishao/aj_bg.png) no-repeat;
  background-size: 100% 100%;

  // border: 1px solid rgba(35, 104, 255, 0.25);
  .latest_case_title {
    width: 100%;
    // height: 40px;
    // background: rgba(31, 73, 135, 0.8);
    // border: 1px solid rgba(35, 104, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 14px 0 18px;

    .aj-remark {
      display: inline-block;
      // width: 145px;
      height: 20px;
      padding: 0 12px;

      border-radius: 10px;
      font-size: 12px;
      font-family: Source Han Sans CN;
      font-weight: 400;
      color: #ffffff;
      line-height: 20px;
    }

    .aj-text {
      padding-left: 10px;
      font-size: 14px;
      font-family: Source Han Sans SC;
      font-weight: 400;
      color: #3cffff;
      line-height: 20px;
    }
  }

  .latest_case_weizhi {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 14px 16px 18px;

    .icon-tip {
      font-size: 12px;
      font-family: Source Han Sans CN;
      font-weight: 400;
      color: #9ed5ff;
      display: flex;
      flex-wrap: wrap;
      li {
        display: flex;
        width: 180px;
        // height: 20px;
        img {
          display: inline-block;
          width: 40px;
          // height: 40px;
        }
        span {
          display: inline-block;
          line-height: 40px;
        }
      }
    }

    .view {
      width: 80px;
      height: 20px;
      background: rgba(31, 73, 135, 0.3);
      border: 1px solid #3cffff;
      border-radius: 10px;
      font-size: 12px;
      font-family: Source Han Sans CN;
      font-weight: 400;
      padding: 0 15px;
      z-index: 99;
      line-height: 20px;
      margin-top: 50px;
      span {
        color: #ffffff;
        cursor: pointer;
      }
    }
  }
  .overView {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .blue {
    background: #0093f3;
  }
  .red {
    background: #d72020;
  }
}
</style>
